var app = getApp();

Page({
    data: {
        disabled: !0,
        zh: "",
        mm: "",
        logintext: "登录",
        werchat: !1
    },
    onLoad: function(t) {
        app.setNavigationBarColor(this);
        var o = this;
        app.util.request({
            url: "entry/wxapp/system",
            cachetime: "0",
            success: function(t) {
                o.setData({
                    xtxx: t.data
                });
            }
        });
    },
    name: function(t) {
        this.setData({
            name: t.detail.value
        });
    },
    password: function(t) {
        this.setData({
            password: t.detail.value
        });
    },
    sign: function(t) {
        wx.showLoading({
            title: "正在提交",
            mask: !0
        });
        let ths=this;
        app.util.request({
            url: "entry/wxapp/StoreLogin",
            cachetime: "0",
            data: {
                user: ths.data.name,
                password: ths.data.password
            },
            success: function(t) {
                if (null != t.data.storeid) {
                    wx.setStorageSync("sjdsjid", t.data.storeid);
                    wx.setStorageSync("StoreName", ths.data.name);
                    wx.setStorageSync("StorePassword", ths.data.password);
                    wx.redirectTo({
                        url: "sjzx/sjzx"
                    })
                } else {
                    wx.showModal({
                        title: "提示",
                        content: t.data
                    });
                }
            }
        });
    }
});